Vue.createApp({
    data() {
        return {
            date: '00:00:00'
        }
    },
    mounted() { //mounted()生命周期：DOM挂载后
        setInterval(() => {
            let d = new Date();
            let h = d.getHours() < 10 ? '0' + d.getHours() : d.getHours();
            let m = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes();
            let s = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds();
            this.date = h + ':' + m + ':' + s;
/*               this.date = d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
*/            }, 1000);
    }
}).mount('#app')